package algorithm.search;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;

/**
 * @author bingo
 * @create 2018-02-28 9:49
 **/
public class Test {

    public static void main(String[] args) {

       Scanner scanner = null;
        try {
            scanner = new Scanner(new File("src\\main\\java\\1.txt"));
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
            if (scanner.hasNextLine()){
                String contents = scanner.useDelimiter("\\A").next();
                System.out.println(contents);
                System.out.println("长度:"+contents.length());
                String[] str = contents.split(" ");
                System.out.println(str.length);
                for(int i=0;i<str.length;i++){
                    System.out.println(str[i]);
                }
                System.out.println(Test.firstCharacterIndex(contents,0));
                System.out.println(Character.isLetter('a'));
            }


        String s = new String( "4");
        String s3 = new String("hello") ;
        Integer a= 6;
        Integer b= 0;

        System.out.println("s.compareTo："+s.compareTo(s3)+""+a.compareTo(b));
    }

    private static int firstCharacterIndex(String s, int start){

        for( int i = start ; i < s.length() ; i ++ )
            if( Character.isLetter(s.charAt(i)) )
                return i;
        return s.length();
    }




}
